package cn.inbot.shopadmin.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;


/**
 * Created by shisenkun on 2021/5/10.
 */
public class UserVo implements Parcelable {
    @SerializedName("i")
    private String userId;
    @SerializedName("u")
    private String username;
    @SerializedName("a")
    private boolean isAuth;
    @SerializedName("f")
    private boolean isFriend;
    @SerializedName("n")
    private String nickname;
    @SerializedName("ip")
    private String isPublic;
    @SerializedName("sn")
    private String robotSerialNumber;
    @SerializedName("ib")
    private boolean isBind;
    @SerializedName("rn")
    private String robotNickname;
    @SerializedName("rm")
    private String robotModel;

    public UserVo() {

    }

    public UserVo(String userId, String username, boolean isAuth,
                  boolean isFriend, String nickname, String isPublic,
                  String robotSerialNumber, boolean isBind,
                  String robotNickname, String robotModel) {
        this.userId = userId;
        this.username = username;
        this.isAuth = isAuth;
        this.isFriend = isFriend;
        this.nickname = nickname;
        this.isPublic = isPublic;
        this.robotSerialNumber = robotSerialNumber;
        this.isBind = isBind;
        this.robotNickname = robotNickname;
        this.robotModel = robotModel;
    }

    public String getUserId() {
        return userId;
    }

    public String getUsername() {
        return username;
    }

    public boolean isAuth() {
        return isAuth;
    }

    public boolean isFriend() {
        return isFriend;
    }

    public String getNickname() {
        return nickname;
    }

    public String getIsPublic() {
        return isPublic;
    }

    public String getRobotSerialNumber() {
        return robotSerialNumber;
    }

    public boolean isBind() {
        return isBind;
    }

    public String getRobotNickname() {
        return robotNickname;
    }

    public String getRobotModel() {
        return robotModel;
    }

    public static Creator<UserVo> getCREATOR() {
        return CREATOR;
    }

    protected UserVo(Parcel in) {
        userId = in.readString();
        username = in.readString();
        isAuth = in.readByte() != 0;
        isFriend = in.readByte() != 0;
        nickname = in.readString();
        isPublic = in.readString();
        robotSerialNumber = in.readString();
        isBind = in.readByte() != 0;
        robotNickname = in.readString();
        robotModel = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(userId);
        dest.writeString(username);
        dest.writeByte((byte) (isAuth ? 1 : 0));
        dest.writeByte((byte) (isFriend ? 1 : 0));
        dest.writeString(nickname);
        dest.writeString(isPublic);
        dest.writeString(robotSerialNumber);
        dest.writeByte((byte) (isBind ? 1 : 0));
        dest.writeString(robotNickname);
        dest.writeString(robotModel);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<UserVo> CREATOR = new Creator<UserVo>() {
        @Override
        public UserVo createFromParcel(Parcel in) {
            return new UserVo(in);
        }

        @Override
        public UserVo[] newArray(int size) {
            return new UserVo[size];
        }
    };


}
